package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class config extends AppCompatActivity {
EditText dollar,euro,won;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.config);

        Intent intent = getIntent();
        float dollar2=intent.getFloatExtra("dollerkey",0f);
        float euro2=intent.getFloatExtra("eurokey",0f);
        float won2=intent.getFloatExtra("wonkey",0f);
        dollar=findViewById(R.id.doller1);
        euro=findViewById(R.id.euro1);
        won=findViewById(R.id.won1);
        dollar.setText(String.valueOf(dollar2));
        euro.setText(String.valueOf(euro2));
        won.setText(String.valueOf(won2));

    }
    public void save(View btn){
        float newdollar=Float.parseFloat(dollar.getText().toString());
        float neweuro=Float.parseFloat(euro.getText().toString());
        float newwon=Float.parseFloat(won.getText().toString());

        Intent reIntent=getIntent();
        Bundle bdl=new Bundle();
        bdl.putFloat("dollerkey2",newdollar);
        bdl.putFloat("eurokey2",neweuro);
        bdl.putFloat("wonkey2",newwon);
        reIntent.putExtras(bdl);
        setResult(2,reIntent);
        finish();




    }
}